home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Source Code
/
Pascal
/
Applications
/
TCPExample
/
PNL Libraries
/
Assembly
/
PreserveA5.p
< prev
Wrap
Text File
|
1997-07-16
|
1KB
|
74 lines
unit PreserveA5;
interface
uses
Types, Files;
const
XParamBlockRecExtra = 4;
type
XParamBlockRec = record
completion: UniversalProcPtr;
pb: HParamBlockRec;
end;
XParmBlkPtr = ^XParamBlockRec;
var
gPreCompletionProc:UniversalProcPtr;
procedure StartupPreserveA5;
function SetPreservedA5:Ptr;
procedure RestoreA5(olda5:Ptr);
implementation
uses
MyCallProc, MyStartup;
{$IFC GENERATINGPOWERPC}
procedure SetupPreserveA5;
begin
end;
function SetPreservedA5:Ptr;
begin
SetPreservedA5:=nil;
end;
procedure RestoreA5(olda5:Ptr);
begin
{$unused(olda5)}
end;
procedure PreCompletion(pbp: ParmBlkPtr);
var
prp: XParmBlkPtr;
begin
prp := XParmBlkPtr(ord(pbp) - XParamBlockRecExtra);
CallIOCompletionProc(pbp, prp^.completion);
end;
{$ELSEC}
procedure PreCompletion(pbp: ParmBlkPtr); external;
procedure SetupPreserveA5; external;
{$ENDC}
function InitPreserveA5( var msg: integer ): OSStatus;
begin
{$unused(msg)}
gPreCompletionProc := NewIOCompletionProc(@PreCompletion);
SetupPreserveA5;
InitPreserveA5 := noErr;
end;
procedure StartupPreserveA5;
begin
SetStartup( InitPreserveA5, nil, 0, nil );
end;
end.